package com.none.web.service.news;

import javax.servlet.http.HttpServletRequest;

import com.none.core.model.Pager;
import com.none.web.model.TNews;

/**
 * 新闻管理Service
 * 
 * @author Summer
 * 
 */
public interface INewsService {

	/**
	 * 新增新闻
	 * 
	 * @param news
	 *            新闻
	 * @return
	 */
	public boolean addNews(TNews news, String tags,String userId,String toBePostedTime,String push,HttpServletRequest request,String pushcontent) throws Exception;


	/**
	 * 新增新闻
	 * 
	 * @param news
	 *            新闻
	 * @return
	 */
	public boolean saveDraft(TNews news, String tags,String userId,String toBePostedTime,String push,HttpServletRequest request,String pushcontent) throws Exception;

	/**
	 * 获取新闻
	 * 
	 * @param pager
	 *            分页参数
	 * @param keyword
	 *            搜索关键字
	 * @return
	 */
	public Object listNews(Pager pager, String keyword, String tagNames,String userId,String type) throws Exception;
	/**
	 * 获取新闻和活动的集合
	 * 
	 * @param pager
	 *            分页参数
	 * @param keyword
	 *            搜索关键字
	 * @return
	 */
	public Object listNewsActivitys(Pager pager, String keyword, String tagNames, String type,String userId) throws Exception;

	/**
	 * 后台管理 获取新闻
	 * 
	 * @param pager
	 *            分页参数
	 * @param keyword
	 *            搜索关键字
	 * @return
	 */
	public Object searchNews(Pager pager, String keyword, String tagName, String fromDate, String toDate,String userId) throws Exception ;

	/**
	 * 更新新闻
	 * 
	 * @param news
	 *            新闻
	 * @param tagNames
	 *            标签
	 * @return 更新后的新闻
	 * @throws Exception
	 */
	public Object editNews(TNews news, String tags,String userId,String toBePostedTime,String push,HttpServletRequest request,String pushcontent) throws Exception;

	/**
	 * 删除新闻
	 * 
	 * @param news
	 *            新闻
	 * @return 删除成功或者失败 flase失败 true成功
	 * @throws Exception
	 */
	public boolean delNews(String id,String userId) throws Exception;

	/**
	 * 分配某新闻到某Beacon
	 * 
	 * @param newsId
	 *            新闻ID
	 * @param beaconId
	 *            BeaconID
	 * @return 新闻
	 * @throws Exception
	 */
	public Object assignToBeacon(String newsId, String beaconId) throws Exception;

	/**
	 * 
	 * @param newsId
 	 * @return
	 */
	public Object auditNewsStatus(String newsId,String status, String userId,String push,HttpServletRequest request,String pushcontent) throws Exception;

	/**
	 * 
	 * @param pager
	 * @param branch
	 * @return
	 */
	public Object listPeding(Pager pager, String userId)throws Exception;

	/**
	 * 
	 * @param news
	 * @param string
	 * @param userId
	 * @return
	 */
	public Object auditPublished(TNews news, String tags, String userId,String toBePostedTime,String push,HttpServletRequest request,String pushcontent) throws Exception;
	
	/**
	 * app端点击推送的消息后获取该消息的详细信息
	 * @param newId
	 * @param type
	 * @param userId
	 * @param appOrPCFlag   pc端调用传PC、APP端调用传APP
	 * @return
	 * @throws Exception
	 */
	public Object getNewsDetialInfo(String newId,String type,String userId,String appOrPCFlag) throws Exception;
}
